package com.freecloud.javabasics.design.proxy.custom;

import com.freecloud.javabasics.design.proxy.FindJob;
import com.freecloud.javabasics.design.proxy.Student;
import com.freecloud.javabasics.design.proxy.custom.core.FreeClassLoader;
import com.freecloud.javabasics.design.proxy.custom.core.FreeProxy;


/**
 * 纯手写，模拟JDK proxy实现动态代理
 * @Author: maomao
 * @Date: 2019-11-22 11:08
 */
public class CustomProxyTest {

    public static void main(String[] args) {

        Class<?> clazz = Student.class;

        CustomProxy proxy = new CustomProxy(new Student());


        FindJob findJob = (FindJob) FreeProxy.newProxyInstance(new FreeClassLoader(),clazz.getInterfaces(),proxy);
        findJob.findJob();

    }
}
